#ifndef G_INI_INCLUDED
#define G_INI_INCLUDED

namespace grace_cpp
{
	namespace file
	{
		class GRACE_CPP_CLASS CustomIniFile
		{
		public:

			CustomIniFile();

			virtual ~CustomIniFile();

			virtual bool SectionExists(const TCHAR* section) = 0;

			virtual bool KeyExists(
				const TCHAR* section,
				const TCHAR* key) = 0;

			virtual int ReadInteger(
				const TCHAR* section,
				const TCHAR* key,
				int _default) = 0;

			virtual TCHAR* ReadString(
				const TCHAR* section,
				const TCHAR* key,
				const TCHAR* _default,
				TCHAR *buf,
				size_t len) = 0;

			virtual double ReadFloat(
				const TCHAR* section,
				const TCHAR* key,
				double _default) = 0;
		};

		class GRACE_CPP_CLASS SimpleIniFile: public CustomIniFile
		{
		private:

			TCHAR m_FileName[MAX_PATH];

		public:

			SimpleIniFile(const TCHAR *FileName);

			virtual ~SimpleIniFile();

			virtual bool SectionExists(const TCHAR* section);

			virtual bool KeyExists(
				const TCHAR* section,
				const TCHAR* key);

			virtual int ReadInteger(
				const TCHAR* section,
				const TCHAR* key,
				int _default);

			virtual TCHAR* ReadString(
				const TCHAR* section,
				const TCHAR* key,
				const TCHAR* _default,
				TCHAR *buf,
				size_t len);

			virtual double ReadFloat(
				const TCHAR* section,
				const TCHAR* key,
				double _default);
		};
	}
}

#endif
